
<%@page import="java.util.List"%>
<%@page import="com.keta.foundation.entity.Module"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" trimDirectiveWhitespaces="true"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include.inc.jsp"%> 

<%!
public String getTreeHTML(List<Module> moduleList) {
	

	if (moduleList.isEmpty())
		return "";
	StringBuffer builder = new StringBuffer();
	builder.append("<ul>");
	for (Module module : moduleList) {
		builder.append("<li><a href=\"javascript:\" onclick=\"$.bringBack({id:'"
				+ module.getId()
				+ "', name:'"
				+ module.getName()
				+ "'})\">" + module.getName() + "</a>" + "\n");
		builder.append(getTreeHTML(module.getChildren()));
		builder.append("</li>" + "\n");
	}
	builder.append("</ul>");
	return builder.toString();
}
%>
<% 
	List<Module> moduleList = (List<Module>)request.getAttribute("moduleList");
	String tree = getTreeHTML(moduleList);
%>

<div class="pageContent">
	<div class="pageFormContent" layoutH="58">
		<ul class="tree expand">
		<li><a href="javascript:" onclick="$.bringBack({id:'1', name:'跟节点'})">跟节点</a>
			<%=tree%>
		</ul>
	</div>
	
	<div class="formBar">
		<ul>
			<li><div class="button"><div class="buttonContent"><button class="close" type="button">关闭</button></div></div></li>
		</ul>
	</div>
</div>